<?php
include_once "top.php";
//接收店长的编号id
$ownerid = $_GET['ownerid'];
$aid=$_GET['aid'];
if ($aid!='') {
    echo  '111';
}
$user=$db->ig2_want('mae_user','id='.$ownerid.' and is_delete=0');
$now = time();
$activeProductSql = "SELECT id,num,score,createtime,productname,isvirtual FROM mae_admin_product_exchange_detail_log ma WHERE userid='".$ownerid."' order by createtime desc";

/*$activeProductSql .= " INNER JOIN mae_admin_exchange_activity aeamae_admin_product_exchange_detail_log_virtual mv ON 
                        ma.id = mv.detaillogid";*/
$activeProductList = $db->ig2_query_select($activeProductSql);
//print_r($activeProductList);exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
    <meta content="telephone=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>积分商城</title>
    <link href="css/discount.css" rel="stylesheet" type="text/css" />
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <script src="inc/jquery.min.js" type="text/javascript"></script>
</head>
<style type="text/css">
    dl *{ display: block; list-style: none; margin:0px; padding: 0px;text-align: center; overflow: hidden; font-weight: bold;font-family: "微软雅黑";}
    dt{width: 100%; height:40px; background: red; height: 30px;line-height:30px; color:#fff;font-size: 16px; font-weight:bold; font-family:'黑体'}
    ol,ul{ width: 80%; padding-top: 10px; margin: 0px auto;  } 
    ol li{ float: left; width:20%;  height:30px; line-height: 30px; font-weight:normal;}
    ul li{ float: left; width:20%; height:38.625px;overflow:hidden; line-height: 38.625px ; border:1px solid #999; border-top:none; border-left: none; border-right: none; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; left: 83.2031px; top: 14.0625px; font-size: 11.4583px; }
    ol {border-bottom: 1px solid #999}
    dl{background: url(images/shop_change.jpg) no-repeat; background-size:100%; background-position: bottom; overflow: hidden;padding-bottom: 120px;}
    ul{height:200px;overflow: auto; }
   
</style>
<body>
<div id="loadings" class="posit99"></div>
    <div class="p4">
        <span class="xm" id="p4text_1" style="top:80px; font-size:36px; left:40px"><?php echo $user['name']?></span>
    <div class="container" >
    <img class="p4bg " src="images/change.jpg">
        <?php if($_GET['source']=='user'){?>
        <img class="bt" id="p4_3" src="images/p2_3.png">
        <?php }?>

<dl>
    <dt>兑换记录</dt>
    <dd>
    <ol>
        <li>日期</li>
        <li>名称</li>
          <li>积分</li>
          <li>数量</li>


    </ol>
        <ul>
        <?php 
         foreach($activeProductList as $list){
                   
          ?>
           
            <li><?php echo date('m月d日',$list['createtime'])?></li>
             <li><?php echo $list['productname']?></li>
            <li><?php echo $list['score']?></li>
             <li><?php echo $list['num']?></li>

            <?php if ($list['isvirtual']==1) {?>
            <li><a href="javascript:void(0)" class="cance" did="<?php echo  $list['id'] ?>"><img src="images/change_3.jpg" height="25px" width="40px" style="float:right; margin-right:20px; margin-top:8px" ></a></li>
            <?php }if($list['isvirtual']!=1){?><li>&nbsp;</li>
                <?php }?>
          <?php }?>
          
   
        </ul>

 
    </dd>

</dl>
<div class='pop_mask'style="display:none; width:100%;height:100%"></div>
<div class="userpop_body" style="display:none;" id="cancel_con1">
    <div class="userpop_body_inner">
        <div class="userpop_body_cancel"><a href="javascript:void(0)" class="cancel2"><img src="images/pop1_cancel.png" width="40" height="40" /></a></div>
        <div class="userpop_body_txt">
            <div class="userpop_body_txt1" style="font-weight:bold; padding-bottom:10px">产品详情</div>
            <div class="userpop_body_txt2" id='assign' style="height:250px;overflow:auto;"></div>
        </div>
        <div class="userpop_body_btn"><a href="javascript:void(0)" class="cancel2">返回</a></div>
    </div>
</div>


</div>
<script type="text/javascript">
    //兑换记录 查看
     $(".cance").click(function(){
        var a=$(this).attr('did');
       // alert(a);
        var url="ra_ajax.php?aid="+a+"";
        var popupWidth =  $(".container").width();
       
        var windowWidth =  $(window).outerWidth();
        var windowHeight =  $(window).outerHeight();
        var popupHeight =200;
        $(".pop_mask").fadeIn(500);
        $("#cancel_con1").css({"position": "absolute", "width":popupWidth+"px"}).animate({left: windowWidth/2-popupWidth/2, top: windowHeight/2-popupHeight, opacity: "show" }, "slow");
         $.get(url,function(data){
           $("#assign").html(data);
           $("#assign").html(data);
         });
        getWidth();
    });
        $(".cancel2").click(function(){
        $(".pop_mask").fadeOut(500);
        $("#cancel_con1").fadeOut(500);
       
    });
   
   

function getWidth(){
    $('.container').width(x);
  
   
}
</script>
</body>
</html>